package com.ulook.lookplanet.data.repository;

import com.ulook.lookplanet.data.source.MainDataSource;
import com.ulook.lookplanet.util.net.ResponseCallback;

/**
 * 描述：
 *
 * @author L1998
 * @data 2021/3/26
 */
public class MainRepository {

    private static volatile MainRepository instance;

    private MainDataSource dataSource;

    private MainRepository(MainDataSource dataSource){
        this.dataSource = dataSource;
    }

    public static MainRepository getInstance(MainDataSource dataSource){
        if(instance == null){
            instance = new MainRepository(dataSource);
        }
        return instance;
    }

    /**
     * 验证登陆信息是否有效
     */
    public void verifyLoginInfo(int id, String pw, ResponseCallback callback){
        dataSource.verifyLoginInfo(id, pw, callback);
    }
}
